﻿using System;
using System.Web.UI.WebControls;
using EmptyWallGallery.Core;
using EmptyWallGallery.Core.Utilities;

namespace EmptyWallGallery.FrontEnd.inside.Contact
{
    public partial class Feedback : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack) return;

            //BindDrop();
            BindGrid();
        }

        private void BindGrid()
        {
            grdListArticle.DataSource = Core.BLL.Feedback.Instance.GetAll();
            grdListArticle.DataBind();
            grdListArticle.GridLines = GridLines.None;
        }

        protected void GrdListArticlePageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            grdListArticle.PageIndex = e.NewPageIndex;
            BindGrid();
        }

        protected string DisplayTitle(string title, int i)
        {
            return Common.Instance.Truncate(title, i, true, true);
        }

        protected string DisplayStatusDate(string releaseDate)
        {
            var dDate = DateTime.Parse(releaseDate).AddHours(Configs.TimeLine);
            return string.Format("{0:dd/MM/yyyy}", dDate);
        }

        protected void BtnApplyClick(object sender, EventArgs e)
        {

        }

        protected void BtnApply2Click(object sender, EventArgs e)
        {

        }
    }
}